using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq.Mapping;
using System.Data.Linq;

namespace Soussous.Business
{
    [Table(Name = "participants")]
    public class Participant : Identifiable
    {
        private EntityRef<User> u_User;
        private EntityRef<Note> n_Note;

        public Participant()
        { 
            this.u_User = new EntityRef<User>();
            this.n_Note = new EntityRef<Note>();
        }

        private int users_id;

        [Column(Storage = "users_id", IsPrimaryKey = true, CanBeNull = false)]
        public int Users_id
        {
            get { return users_id; }
            set { users_id = value; }
        }

        private int notes_id;

        [Column(Storage = "notes_id", IsPrimaryKey = true, CanBeNull = false)]
        public int Notes_id
        {
            get { return notes_id; }
            set { notes_id = value; }
        }

        private int amount;

        [Column(Storage = "amount")]
        public int Amount
        {
            get { return amount; }
            set { amount = value; }
        }
        
        [Association(Storage = "u_User", ThisKey = "Users_id")] 
        public User user 
        {
            get 
            {
                return this.u_User.Entity;

            }
            set 
            {
                this.u_User.Entity = value;
            }
        
        }

        [Association(Storage = "n_Note", ThisKey = "Notes_id")]
        public Note note
        {
            get
            {
                return this.n_Note.Entity;

            }
            set
            {
                this.n_Note.Entity = value;
            }

        }

    }
}
